package model;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by admin on 2016/8/16.
 */
public class Order implements Serializable{
    private int id;
    private Integer total;
    private Integer receive;
    private Integer zhaoling;
    private Date time;
    private Set<Detail> details = new HashSet<Detail>(0);

    public Order(){
        this.total = 0;
        this.receive = 0;
        this.zhaoling = 0;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getReceive() {
        return receive;
    }

    public void setReceive(Integer receive) {
        this.receive = receive;
    }

    public Integer getZhaoling() {
        return zhaoling;
    }

    public void setZhaoling(Integer change) {
        this.zhaoling = change;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Order order = (Order) o;

        if (id != order.id) return false;
        if (total != null ? !total.equals(order.total) : order.total != null) return false;
        if (receive != null ? !receive.equals(order.receive) : order.receive != null) return false;
        if (zhaoling != null ? !zhaoling.equals(order.zhaoling) : order.zhaoling != null) return false;
        if (time != null ? !time.equals(order.time) : order.time != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (total != null ? total.hashCode() : 0);
        result = 31 * result + (receive != null ? receive.hashCode() : 0);
        result = 31 * result + (zhaoling != null ? zhaoling.hashCode() : 0);
        result = 31 * result + (time != null ? time.hashCode() : 0);
        return result;
    }

    public Set<Detail> getDetails() {
        return details;
    }

    public void setDetails(Set<Detail> details) {
        this.details = details;
    }
}
